package com.example.a111;

import androidx.appcompat.app.AppCompatActivity;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.example.a111.R;

public class startActivity extends AppCompatActivity implements View.OnClickListener {

    private static final String TAG = "liu";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "startActivity onCreate");
        setContentView(R.layout.activity_start);
        findViewById(R.id.next).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        // 1.在Intent的构造函数中指定
        Intent intent = new Intent(this,finishActivity.class);

        // 2.调用意图对象的setClass方法指定
        //Intent intent = new Intent();
        // intent.setClass(this,ActFinishActivity.class);
        // 3.调用意图对象的setComponent方法指定
        //ComponentName component = new ComponentName(this, ActFinishActivity.class);
        //intent.setComponent(component);
        startActivity(intent);
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG, "startActivity onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG, "startActivity onResume");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG, "startActivity onPause");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG, "startActivity onStop");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG, "startActivity onDestroy");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d(TAG, "startActivity onRestart");
    }
}